package com.my.screens;

import java.io.IOException;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Array;
import com.my.drinkinggame.Main;
import com.my.drinkinggame.Renderer;
import com.my.drinkinggame.StaticFonts;
import com.my.drinkinggame.StaticSprites;
import com.my.simulation.Card;
import com.my.simulation.Card.CardType;

public class RulesScreen extends Screen {
	Main main;
	public OrthographicCamera cam;
	Vector3 translationVector;
	public float xPos;
	public float yPos;
	public Sprite bg;
	public String headerString;
	public String contentString;
	public RulesScreen(Main m) {
		cam = new OrthographicCamera();
		translationVector = new Vector3();
		main = m;
		headerString = "";
		contentString = "";
		xPos = 0;
		yPos = 0;
	}

	public void enter() {
		Gdx.input.setCatchBackKey(true);
		Gdx.input.setInputProcessor(this);
	}

	@Override
	public boolean keyDown(int arg0) {
		if (Input.Keys.BACK == arg0) {
			//set back to rule screen 1
			main.setScreen(Main.SCREEN_MAINMENU);
		}
		return false;
	}

	@Override
	public boolean keyTyped(char finalChar) {
		return false;
	}

	@Override
	public boolean keyUp(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean scrolled(int arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean touchDown(int x, int y, int arg2, int arg3) {
		translationVector.set(x,y,0);
		cam.unproject(translationVector);
		xPos = translationVector.x;
		yPos = translationVector.y;
		return false;
	}

	@Override
	public boolean touchDragged(int x, int y, int arg2) {
		translationVector.set(x,y,0);
		cam.unproject(translationVector);
		xPos = translationVector.x;
		yPos = translationVector.y;
		return false;
	}

	public boolean touchMoved(int x, int y) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean touchUp(int x, int y, int arg2, int arg3) {
		translationVector.set(x,y,0);
		cam.unproject(translationVector);
		return false;
	}


	@Override
	public void update() {

	}


	@Override
	public void render() {
		Renderer.getInstance().renderRulesScreen(this);
	}

	public void renderRulesScreen(SpriteBatch sb) {
		StaticSprites.plainBG.draw(sb);
	}

	public boolean mouseMoved(int screenX, int screenY) {
		// TODO Auto-generated method stub
		return false;
	}
}
